package com.csp.mingyue.oss.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.csp.mingyue.oss.api.entity.SysOss;
import com.csp.mingyue.oss.api.vo.SysOssVo;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * <p>
 * OSS对象存储表 服务类
 * </p>
 *
 * @author njy
 * @since 2023-09-12 09:19:12
 */
public interface SysOssService extends IService<SysOss> {

	/**
	 * 文件上传
	 * @param file 文件
	 * @return 对象存储对象
	 */
	SysOssVo upload(MultipartFile file);

	/**
	 * 删除OSS对象存储
	 * @param ossIds oss对象Ids
	 * @return 是否删除成功
	 */
	Boolean deleteByOssIds(List<Long> ossIds);

	/**
	 * 下载OSS对象存储
	 * @param ossId oss对象Ids
	 * @param response 响应
	 * @throws IOException
	 */
	void download(Long ossId, HttpServletResponse response) throws IOException;

}
